import React, { Component,Suspense } from 'react';
import {HashRouter as Router,Route} from "react-router-dom"
import routes from "./index"

export default class RouterConfig extends Component {
    render() {
        return (
            <Suspense fallback={<div>......</div>}>
              <Router>
             
                  {
                    routes.map(r=>{
                      return <Route key={r.path} exact={r.exact} path={r.path} render={(props)=><r.component {...props}></r.component>}></Route>
                    })
                  }
             
              </Router>
            </Suspense>
          );
    }
}
